package com.heima.search.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.search.dto.ApArticleSearchDto;
import com.heima.search.service.IUserSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/history")
public class UserSearchController {

    @Autowired
    private IUserSearchService userSearchService;

    @PostMapping("/load")
    public ResponseResult load(@RequestBody ApArticleSearchDto dto) {
        return userSearchService.load(dto);
    }

    @PostMapping("/del")
    public ResponseResult del(@RequestBody ApArticleSearchDto dto){
        return userSearchService.del(dto);
    }
}
